package com.mioto.ld.communication.websocket.resolver;

import com.mioto.ld.communication.websocket.model.SendCmdEnum;
import com.mioto.ld.communication.websocket.model.WsRecMessage;
import com.mioto.ld.communication.websocket.util.MessageSendUtil;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;

/**
 * @author mioto-qinxj
 * @date 2024/5/16
 * @desc 不支持的协议处理类
 */
@Slf4j
public class WsDefMessageResolver implements WsMessageResolver{

    @Override
    public void resolve(ChannelHandlerContext channelHandlerContext, WsRecMessage message) {
        log.info("Not support websocket protocol data - {}",message);
        MessageSendUtil.send(channelHandlerContext.channel(), SendCmdEnum.BAD_REQUEST);
    }
}
